﻿@model IEnumerable<OPM.Models.SearchCases>
@using System.Web.Mvc;
@{
    ViewBag.Title = "ค้นหา";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}

<div class="titleTab-line"></div>
<div class="searchBody">

    @if (Model.Count() > 0 )
    {
        foreach (var o in Model)
        {
        <div class="searchBox">
            <a href="@Url.Action("ViewCase", "GroupList", new { id = o.obj_id, status = "" })">@Html.Raw(o.headline) @o.story_time</a>
            <p>@Html.Raw(o.description)</p>
            <time>@o.display_time</time>
        </div>
        }
    <a href="#" class="timelineMore searchMore">More</a>
    }
    else
    {
         <div class="searchBox2">
            <a href="#"></a>
            <p>ไม่พบข้อมูลที่ค้นหา</p>
            <time></time>
        </div>
    }
   
</div>

   

<script src="~/js/timeline-detail.js"></script>
<script>
$(document).ready(function() {
    var countItem = $('.searchBox').length;
    if (countItem == 0) {
        $('.searchMore').hide();

        var main_menu = $('body').height();
        $('.main_menu').css('min-height', main_menu-30);
        var search_box = $('.main-logo').height();
        $('.search-box').height(search_box - 4);
        $('.search-icon').height(search_box - 2);
    }
});
</script>
